﻿namespace WizardControl.Views
{
    /// <summary>
    /// Interface for a wizard page
    /// </summary>
    public interface IPage
    {
        /// <summary>
        /// An object containing data that this page can use
        /// </summary>
        object InputData
        {
            get;
            set;
        }

        /// <summary>
        /// An object containing data that will be passed to the InputData property of the next page
        /// </summary>
        object OutputData
        {
            get;
            set;
        }

        /// <summary>
        /// The wizard control that this page belongs to
        /// </summary>
        WizardControl.Wizard ParentWizard
        {
            get;
            set;
        }

        /// <summary>
        /// The number of this page
        /// </summary>
        /// <returns>A page number</returns>
        int PageNumber();
       
        /// <summary>
        /// The caption to use for this page
        /// </summary>
        /// <returns>A page caption</returns>
        string PageCaption();

        /// <summary>
        /// The state of the Finish button
        /// </summary>
        /// <returns>If true then Finishg will be active</returns>
        bool AllowFinish();

        /// <summary>
        /// The state of the Cancel button
        /// </summary>
        /// <returns>If true then the Cancel button will be active</returns>
        bool AllowCancel();

        /// <summary>
        /// The state of the Back button
        /// </summary>
        /// <returns>If true then the Back button will be active</returns>
        bool AllowBack();

        /// <summary>
        /// The state of the Forward button
        /// </summary>
        /// <returns>If true then the Forward button will be active</returns>
        bool AllowForward();

        /// <summary>
        /// Validate data on the current page
        /// </summary>
        /// <returns>If true then the next page will be displayed, otherwise we remain on the current page</returns>
        bool ValidatePage();

        /// <summary>
        /// The next page to progress to when forward is clicked
        /// </summary>
        /// <returns>The next page number</returns>
        int NextPageNumber();

        /// <summary>
        /// Called just before the page is displayed
        /// </summary>
        void PageActivated();

        /// <summary>
        /// Called just after the page is validated, before the next page is displayed
        /// </summary>
        void PageDeactivated();
    }
}
